import {
  basicHomeData,
  basicMapData,
  detectionEntity,
  proportionEntity,
  TokenRequestData,
} from '@/types'

export type queryBatteryRequestData = TokenRequestData

/**
 * 站点异常数据
 * @param storeName - 站点名称
 * @param storeId - 站点id
 * @param chargeCount - 充电数量
 * @param abnormalCount - 异常数量
 */
export interface storeAbnormalDTOEntity {
  storeName: string
  storeId: string
  chargeCount: number
  abnormalCount: number
  dataTime: string
}
export type locateType = '联网' | '断网'
/**
 * 电池数据
 * @param batteryLockId - 电池中控
 * @param longitude - 经度
 * @param latitude - 纬度
 * @param locate - 联网状态
 */
export interface batteryDataDTOEntity extends basicMapData {
  batteryLockId: string
  locate: locateType
  abnormalStatus: string
  electricCurrent: string
  voltage: string
  batteryNumber: string
  batteryStatus: string
  updatedTime: string
  mosTemperatureStatus: string
  chargeOverCurrentStatus: string
}
/** 门店数据
 * @param address - 地址
 * @param batteryTotal - 电池总数
 * @param cityName - 城市
 * @param contactPerson - 联系人
 * @param contactPhone - 联系电话
 * @param createdTime - 创建时间
 * @param imageUrls - 图片地址
 * @param latitude - 纬度
 * @param longitude - 经度
 * @param merchantId - 商家id
 * @param serviceTime - 服务时间
 * @param status - 状态
 * @param storeId - 门店id
 * @param storeName - 门店名称
 */
export interface storeListEntity extends basicMapData {
  address: string
  batteryTotal: number
  cityName: string
  contactPerson: string
  contactPhone: string
  createdTime: string
  imageUrls: string
  merchantId: string
  serviceTime: string
  status: string
  storeId: number
  storeName: string
}
/**
 * 严重异常警告
 * @param id - id
 * @param batteryLockId - 电池中控
 * @param storeId - 门店id
 * @param abnormalType - 异常类型
 * @param alarmContent - 告警内容
 * @param pushMode - 推送方式
 * @param receiverName - 处理人姓名
 * @param receiverPhone - 处理人电话
 */
export interface pushDataEntity {
  id: string
  batteryLockId: string
  storeId: string
  abnormalType: string
  alarmContent: string
  pushMode: string
  receiverName: string
  receiverPhone: string
}

/**
 * 电池首页数据
 * @param batteryTotal - 电池总数
 * @param storeTotal - 门店总数
 * @param batteryNormalTotal - 正常电池数
 * @param batteryStaticTotal - 静止电池数
 * @param batteryAbnormalTotal - 异常电池数
 * @param batteryChargeTotal - 充电电池数
 * @param batteryUsingTotal - 使用中电池数
 * @param batteryTemperatureTotal - 温度异常电池数
 * @param storeNormalTotal - 正常站点数
 * @param storeAbnormalTotal - 异常站点数
 * @param storeAbnormalDTO - 站点异常数据
 * @param batteryDataDTO - 电池数据
 * @param storeList - 门店数据
 * @param getRealtimeDataset - 循环次数统计图表
 * @param getAbnormalTrend - 电池异常趋势图表
 * @param pushData - 严重异常警告
 */
export interface queryBatteryResponseData {
  batteryTotal: number
  storeTotal: number
  batteryNormalTotal: number
  batteryStaticTotal: number
  batteryAbnormalTotal: number
  batteryChargeTotal: number
  batteryUsingTotal: number
  batteryTemperatureTotal: number
  storeNormalTotal: number
  storeAbnormalTotal: number
  storeAbnormalDTO: storeAbnormalDTOEntity[]
  batteryDataDTOList: batteryDataDTOEntity[]
  storeList: storeListEntity[]
  getRealtimeDataset: basicHomeData<string[][]>
  getTrend: basicHomeData<string[][]>
  pushData: basicHomeData<pushDataEntity[]>
  boxTotal: number
  chargingStationTotal: number
  detection: basicHomeData<detectionEntity[]>

  record: basicHomeData<storeAbnormalDTOEntity[]>
  proportion: basicHomeData<proportionEntity[]>
}

export type queryBatteryResponse = ApiResponseData<queryBatteryResponseData>
